<div class="centered">
<div id="calendar_select">
<div>Select date</div>
<input class="textinput" id="calendar" type="text" />
</div>
</div>

<script type="text/javascript">
$(function() 
{
	
	$("button").button();
	$("#calendar").datepicker(
			{ 
				changeYear: true, 
				changeMonth: true, 
				yearRange: '1980:',
				dateFormat: 'yy-mm-dd',
				onSelect : function(dateText, inst) {
					var params = new Array();
					<?php if ($country_id > 0) {?>
						params.push("country=" + "<?php echo $country_id ?>"); 
					<?php }?>
					params.push("date=" + dateText);
					window.location.href = "index.php?" + get_params(params);
				} 
			});
	$("button.ui-datepicker-current").live('click', function() {
	    $.datepicker._curInst.input.datepicker('setDate', new Date()).datepicker('hide');
	});
	<?php if ($date != "") {?>
	$("#calendar").datepicker("setDate", "<?php echo $date?>");
	<?php }?>
});
</script>